package com.user.pojo;

import java.text.SimpleDateFormat;
import java.util.Date;

public class User {
	private static User user = new User();
	private int id;
	private String userId;
	private String userPassword;
	private String userName;

	private Date userBirth;
	private String userGender;
	private String userPhone;
	private String userEmail;
	private int isDelete;

	public int getIsDelete() {
		return isDelete;
	}

	public void setIsDelete(int isDelete) {
		this.isDelete = isDelete;
	}

	private User() {

	}

	public static User getInstance() {
		return user;
	}
	
	public static void setUser(User anotherUser) {
//		user.setId(anotherUser.getId());
//		user.setUserId(anotherUser.getUserId());
//		user.setUserPassword(anotherUser.getUserPassword());
//		user.set
		user = anotherUser;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getUserPassword() {
		return userPassword;
	}

	public void setUserPassword(String userPassword) {
		this.userPassword = userPassword;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getUserBirth() {
		SimpleDateFormat sdf =  new SimpleDateFormat("yyyy-MM-dd");
		return sdf.format(userBirth);
	}

	public void setUserBirth(Date userBirth) {
		this.userBirth = userBirth;
	}

	public String getUserGender() {
		return userGender;
	}

	public void setUserGender(String userGender) {
		this.userGender = userGender;
	}

	public String getUserPhone() {
		return userPhone;
	}

	public void setUserPhone(String userPhone) {
		this.userPhone = userPhone;
	}

	public String getUserEmail() {
		return userEmail;
	}

	public void setUserEmail(String userEmail) {
		this.userEmail = userEmail;
	}

	
	@Override
	public String toString() {
		return "User [id=" + id + ", userId=" + userId + ", Password=" + userPassword + ", Name=" + userName
				+ ", Birth=" + getUserBirth() + ", Gender=" + userGender + ", Phone=" + userPhone
				+ ", Email=" + userEmail + ",isDelete=" + isDelete + "]";
	}
}
